"""
这个文件里指明了在访问一个页面时要调用的视图等的映射，确保在访问时可以正确定位到你要实现的功能
mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path

# 导入博客相关的视图
from blog import views
# 导入登录注册相关的视图
from login import login_views

from django.conf.urls import include

# 下面的/可以去掉，不然请求路径后面必须加/才能路由，诸如：GET http://127.0.0.1:8000/get_account_by_account_id/?accountId=8 一样
# 下面的单个删除账户操作就去掉后面的/，然后请求路径为 DELETE http://127.0.0.1:8000/delete_account?accountId=2
# url路由配置
from order import order_views

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('admin/', admin.site.urls),
    # 用户登录与注册相关的路由
    path('index', login_views.index),
    path('login', login_views.login),
    path('register', login_views.register),
    path('logout', login_views.logout),
    # 增加图片验证码的功能
    re_path(r'^captcha', include('captcha.urls')),
    # 博客app相关的路由配置
    path('show_time/', views.show_time),
    path('get_all_account_list/', views.get_all_account_list),
    path('get_account_by_account_id/', views.get_account_by_account_id),
    path('get_account_list_by_paginator/', views.get_account_list_by_paginator),
    path('get_account_list_by_paginator_html/', views.get_account_list_by_paginator_html_view),
    path('create_account/', views.create_account),
    path('patch_create_account/', views.patch_create_account),
    path('update_account/', views.update_account),
    path('patch_update_account/', views.patch_update_account),
    path('delete_account', views.delete_account),
    path('patch_delete_account', views.patch_delete_account),
    path('skip_upload', views.skip_upload),
    path('upload_file', views.upload_file),
    # 文件下载路由
    re_path(r'^download/(?P<file_name>.*)/$', views.download_file, name="download"),
    # 订单相关的路由
    path('get_order_by_order_id', order_views.get_order_by_order_id),
    path('get_transaction_detail_by_tx_id', order_views.get_transaction_detail_by_tx_id),
]
